<div>
    <ng-form name="newRules" novalidate="" class="template container">
        <!-- {{fileName}} -->
        <!-- <div class="modal-content"> -->

        <!-- <span ng-show="isSaved" class="saved">
          {{addData.name}}

        </span> -->
        <!-- <input type='text' ng-model='testing'/> -->
        <!-- {{testObj}}
        {{postData}} -->

        <!-- {{obj.mode}} -->
        <div class="content">

            <!-- <div class="modal-header"> -->
            <!-- <div class="header"> -->
            <!-- <button type="button" data-dismiss="modal" aria-label="Close" class="close"><span aria-hidden="true">&times;</span></button> -->
            <!-- <h4 id="myModalLabel" class="modal-title">添加新规则</h4> -->
            <!-- <h4>添加规则</h4> -->
            <!-- {{ruleData.text.fileName}} -->
            <!-- </div> -->
            <!-- <div class="modal-body"> -->
            <div class="body">

                <div class="col-md-6 col-sm-6">
                    <!-- 规则名称-->
                    <div class="form-group">
                        <label for="rule-name" class="control-label">规则名称<span class="help" ng-show="isTested">*</span>
                        </label>
                        <!-- <div class="col-md-8"> -->
                        <input type="text" name="rule-name" ng-model="ruleObj.name" class="form-control">
                        <!-- </div> -->
                    </div>
                    <!-- 规则模式-->
                    <div class="form-group">
                        <label for="rule-type" class="control-label">规则模式<span class="help">*
                            </span>
                        </label>
                        <!-- <div class="col-md-8"> -->
                        <select name="rule-type" ng-model="ruleObj.type" class="form-control" required ng-change="test()">
                            <option ng-repeat="mode in modes" value="{{mode.value}}" ng-selected="ruleObj.type==mode.value">
                                {{mode.content}}
                            </option>

                        </select>
                        <!-- {{ruleData.type}} -->
                        <!-- </div> -->
                    </div>
                    <!-- 自定义规则填写-->
                    <div class="form-group">
                        <label for="rule-start" ng-hide="ruleObj.type==3" class="control-label">开头<span class="help">*
                            </span>
                        </label>
                        <label for="rule-start" ng-show="ruleObj.type==3" class="control-label">全文<span class="help">*
                            </span>
                        </label>
                        <!-- <div class="col-md-8"> -->
                        <textarea rows="7" name="rule-start" ng-model="ruleObj.beginText" class="form-control" required ng-change="test()"></textarea>
                        <!-- </div> -->
                    </div>
                    <div ng-show="ruleObj.type==2" class="form-group">
                        <label for="rule-end" class="control-label">结束<span class="help">*
                            </span>
                        </label>
                        <!-- <div class="col-md-8"> -->
                        <textarea rows="1" name="rule-end" ng-model="ruleObj.endText" class="form-control" ng-required="ruleObj.type==2" ng-change="test()"></textarea>
                        <!-- </div> -->
                    </div>
                    <!-- 最少标签数 -->
                    <div class="form-group">
                        <label for="limit">最少标签数</label>
                        <div class="clearfix"></div>
                        <div class="col-md-11 col-sm-11">
                          <input type="range" name="limit" min="0" max="10" class="form-control" ng-model="ruleObj.limit" ng-change="test()">
                        </div>
                        <div class="col-md-1 col-sm-1">
                          {{ruleObj.limit}}
                          <!-- <input type="number" min="0" max="10" class="form-control" ng-model="limitTemp"> -->
                        </div>
                    </div>
                    <div class="clearfix"></div>
                    <!-- 模糊度 -->
                    <div class="form-group">
                        <label for="similar">模糊系数（系数越小越精确）</label>
                        <div class="clearfix"></div>
                        <div class="col-md-11 col-sm-11">
                          <input type="range" name="similar" min="0" max="10" class="form-control" ng-model="ruleObj.similar" ng-change="test()">
                        </div>
                        <div class="col-md-1 col-sm-1">
                          {{ruleObj.similar}}
                        </div>

                    </div>
                </div>

                <div class="col-md-6 col-sm-6">
                    <!-- 测试文件 -->
                    <div class="form-group" ng-show="testType=='file'">
                        <label for="" class="control-label">测试文件<span class="help">*
                            </span>
                        </label>
                        <!-- <div class="col-md-8"> -->
                        <pre>{{realFileName}}</pre>

                        <!-- </div> -->
                    </div>
                    <!-- 测试文本 -->
                    <div class="form-group test" ng-show="testType=='string'">
                        <label for="rule-text" class="control-label">选择文章<span class="help">*
                            </span>
                        </label>

                        <!-- 非主规则：选择文章 -->
                        <!-- <div class="col-md-8"> -->
                        <select name="rule-text" ng-model="testObj.content" class="form-control" ng-required="testType=='string'" ng-click="showArticle()">
                            <option ng-repeat="a in articleList" value={{a.text}}>
                                文章{{$index+1}}
                            </option>

                        </select>
                        <!-- </div> -->

                    </div>

                    <!-- 文章内容 -->
                    <div class="form-group" ng-show="testType=='string'&&!showRuleResult">
                        <!-- <br/> -->
                        <label for="" class="control-label">文章内容</label>
                        <!-- <div class="col-md-8"> -->
                        <pre class="testResult">{{testObj.content}}</pre>

                        <!-- 共有{{testRuleResult.length}}条记录 -->
                        <!-- <ul> -->
                        <!-- <li ng-repeat="res in testRuleResult"> -->
                        <!-- {{testRuleResult}} -->
                        <!-- </li> -->
                        <!-- </ul> -->
                        <!-- </div> -->
                    </div>

                    <!-- 测试结果显示 -->
                    <div class="form-group" ng-show="testType=='file'||showRuleResult">
                        <label for="" class="control-label">测试结果</label>
                        <!-- <div class="col-md-8"> -->
                        <pre class="testResult"><b>{{testRuleResult.info}}</b><ul><li ng-repeat="t in testRuleResult.data"><b>第{{$index+1}}条记录</b><br />{{t.text}}</li></ul><hr ng-show="testRuleResult.highlightText"/>在原文中位置：<br /><span  ng-bind-html="testRuleResult.highlightText"></span></pre>

                        <!-- 共有{{testRuleResult.length}}条记录 -->
                        <!-- <ul> -->
                        <!-- <li ng-repeat="res in testRuleResult"> -->
                        <!-- {{testRuleResult}} -->
                        <!-- </li> -->
                        <!-- </ul> -->
                        <!-- </div> -->
                    </div>
                </div>

                <div class="clearfix"></div>
                <!-- {{testType}} -->

                <!-- <pre ng-bind-html="testa"></pre> -->
                <!-- <br /> -->
                <!-- {{testa}} -->

                <!-- 提示信息-->
                <div class="hint" ng-hide="isSaved">*为必填项，必须先测试再保存</div>
                <!-- {{addData}} -->

                <!-- 保存结果提示 -->
                <div class="save-hint" ng-class="{true:'save-success', false:'save-fail'}[isSaved]">
                    <span class="glyphicon" ng-class="{true:'glyphicon-ok', false:'glyphicon-remove'}[isSaved]"></span>
                    {{saveInfo}}
                </div>

            </div>

            <!-- 按钮 -->
            <div class="footer">

                <!-- <button type="button" data-dismiss="modal" class="btn btn-default">取消</button> -->
                <!-- <button type="button" class="btn btn-default">取消</button> -->
                <button type="button" ng-click="test()" ng-disabled="newRules.$invalid" class="btn btn-warning">测试</button>
                <button type="button" ng-click="save()" ng-disabled="!isTested||!ruleObj.name" class="btn btn-info">保存</button>
                <!-- <button type="button" class="btn btn-info" ng-click="abc()">abc</button> -->
            </div>

        </div>
    </ng-form>

</div>
